﻿@using WebUI.Models
@model CategoriaModel

@using (Html.BeginForm("Index", "Categoria", FormMethod.Post, new {@id="form-categoria" })) {
    @Html.ValidationSummary(true)
    @Html.TextBoxFor(m => m.NomeCategoria)
    @Html.ValidationMessageFor(m => m.NomeCategoria)
    @Html.DropDownListFor(m => m.IdCategoriaMae, (SelectList)ViewBag.Subs, "Selecione")

    <button id="button-enviar-categoria">Enviar</button>
}
<table>
    <tbody>
    @{Html.RenderPartial("Categorias", (IList<CategoriaItemModel>)ViewBag.Categorias);}
    </tbody>
</table>